<?php

require_once dirname(__FILE__) . '/includes/app.php';

Helper::renderView('head', INCPATH_VIEWS);

if ($user) {
    try {
        $facebook->api('/me');
    } catch (FacebookApiException $e) {
        echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
    }
}

if ($user) {
    $app = new Dapadarse($facebook); 
    Helper::renderView('main', INCPATH_VIEWS);
}

Helper::renderView('footer', INCPATH_VIEWS);